package com.lcf.system.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.lcf.system.dao.SysAddressDao;
import com.lcf.system.entity.SysAddress;
import com.lcf.system.service.SysAddressService;
import com.lcf.system.vo.SysAddressVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 地区表(SysAddress)表服务实现类
 *
 * @author lcf
 * @since 2025-05-02 11:55:03
 */
@Service("sysAddressService")
public class SysAddressServiceImpl extends ServiceImpl<SysAddressDao, SysAddress> implements SysAddressService {
    @Override
    public List<SysAddressVO> list(long pid) {
        List<SysAddress> list = Db.lambdaQuery(SysAddress.class)
                .eq(SysAddress::getPid, pid)
                .list();

        return BeanUtil.copyToList(list, SysAddressVO.class);
    }
}

